<?php include COMMON_PATH.'/header.html'; ?>
<div class="page page_memberinfo page_storequlif">
  <div class="weui-body">
    <div class="weui-cells">
      <div class="weui-cell">
        <div class="weui-cell__hd">
          <p>商户名称</p>
        </div>
        <div class="weui-cell__bd" data-info="name"></div>
      </div>
      <div class="weui-cell" id="agent" style="display: none;">
        <div class="weui-cell__hd">
          <p>法人名称</p>
        </div>
        <div class="weui-cell__bd" data-info="agent"></div>
      </div>
      <div class="weui-cell" id="agentCard" style="display: none;">
        <div class="weui-cell__hd">
          <p>法人身份证</p>
        </div>
        <div class="weui-cell__bd" data-info="agentCard"></div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd">
          <p>统一信用代码</p>
        </div>
        <div class="weui-cell__bd" data-info="personCode"></div>
      </div>
    </div>
    <div class="weui-cells">
      <div class="qualif-wrapper">
        <h3 class="title">个体工商户营业执照</h3>
        <img src="" data-info="businessImg">
      </div>
    </div>
  </div>
</div>
<?php include COMMON_PATH.'/footer.html'; ?>
<script>
  $(function() {
    var loading = weui.loading();
    $.ajax({
      url: '/mobile/store/attestinfo',
      dataType: 'json',
      type: 'POST',
      data: {},
      success: function(res) {
        if (mobileCommon.loginTips(res.code, res.msg)) {
          return false;
        }
        if (res.code == 1) {
          var data = res.data;
          if (data.agent) {
            $('[data-info="agent"]').text(data.agent);
            $('#agent').show();
          }
          if (data.agent) {
            $('[data-info="agentCard"]').text(data.agent_idcard);
            $('#agentCard').show();
          }
          $('[data-info="name"]').text(data.storesName);
          $('[data-info="personCode"]').text(data.personCode);
          $('[data-info="businessImg"]').attr('src', data.businessImg);
        }
      },
      complete: function() {
        loading.hide();
      }
    })
  })
</script>